07. Review: Relationships & Joins

Model RELATIONSHIPS b/t todo lists and todo items Heading

Review: Relationships & Joins

ND004 C01 L07 07 Recall Relationships

Inner vs Outer Join

What is the difference between an inner join and an outer join?

SOLUTION: An INNER join selects all rows from both tables that have a match between the columns

SQL JOIN

By default, in SQL, specifying the keyword JOIN (with no prefix) refers to a/an

SOLUTION: INNER JOIN

Join Quiz

QUIZ QUESTION: :

Here's the SQL join example shown in the above video:

SELECT make, model, year FROM vehicles
    JOIN drivers
    ON vehicles.driver_id = drivers.id
    WHERE drivers.name = 'Sarah';

See if you can label the following parts of the statement:

ANSWER CHOICES:



Part of join statement

What is it?

vehicles.driver_id

drivers

drivers.id

vehicles

SOLUTION:

Part of join statement

What is it?

vehicles.driver_id

drivers

drivers.id

vehicles